package springstudy;

import org.springframework.boot.WebApplicationType;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.context.ConfigurableApplicationContext;
import springstudy.service.CalculateService;

/**
 * profile 启动类 {@link CalculateService}
 * @Author acy
 * @Date 2019/04/24
 */
@SpringBootApplication(scanBasePackages = {"springstudy.service"})
public class CalculateServiceBootStrap {
	public static void main(String[] args) {
		ConfigurableApplicationContext applicationContext = new SpringApplicationBuilder(CalculateServiceBootStrap.class)
				.web(WebApplicationType.NONE)
				.profiles("java8")
				.run(args);
		CalculateService calculateService = applicationContext.getBean( CalculateService.class);
		System.out.println("calculateService Bean "+calculateService.sum(1,2,3,4,5,6,7,8,9));
		//关闭上下文
		applicationContext.close();
	}
}
